package com.qdxwx.data.mapper.document;

import com.qdxwx.common.page.PageRequest;
import com.qdxwx.models.document.Document;
import com.qdxwx.models.document.DocumentDetail;
import com.qdxwx.models.document.DocumentQuery;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Qdx NetSchool Platform
 * @author qdxwx
 * @updateTime 2022/5/25
 * @description
 */
@Repository
public interface DocumentMapper {

    int insertDocument(DocumentDetail document);

    DocumentDetail selectById(int id);

    Document selectLast(long id,@Param(value = "e") DocumentQuery query);

    Document selectNext(long id,@Param(value = "e") DocumentQuery query);

    List<Document> selectListTop(@Param(value = "e") DocumentQuery query, int limit);

    List<Document> selectList(@Param("e") DocumentQuery query, @Param("page") PageRequest page);

    int selectCount(@Param("e") DocumentQuery query);

    int updateDocument(DocumentDetail document);

    int deleteById(int id);

    int updateView(int id);

    int updateDown(int id);

    int updateLike(int id);
}
